/*
 * 
 * @author Barry Britt
 */

package dmtools;

import java.io.Serializable;

/**
 *
 * @author britt
 */
public abstract class Skills implements Serializable {
    private int    strength,
                   constitution,
                   dexterity,
                   intelligence,
                   wisdom,
                   charisma,
                   armorClass,
                   level,
                   maxFortDefense,
                   currentFortDefense,
                   maxRefDefense,
                   currentRefDefense,
                   maxWillDefense,
                   currentWillDefense,
                   initiative,
                   maxHP,
                   currentHP,
                   speed,
                   actionPoints,
                   acrobatics,
                   arcana,
                   athletics,
                   bluff,
                   diplomacy,
                   dungeoneering,
                   endurance,
                   heal,
                   history,
                   insight,
                   intimidate,
                   nature,
                   perception,
                   religion,
                   stealth,
                   streetwise,
                   theivery,
                   healingSurge;
    /**
     *
     * @return integer (Strength)
     */
    public int getStr()                      { return strength; }
    public int getCon()                      { return constitution; }
    public int getDex()                      { return dexterity; }
    public int getInt()                      { return intelligence; }
    public int getWis()                      { return wisdom; }
    public int getCha()                      { return charisma; }
    public int getAC()                       { return armorClass; }
    public int getLevel()                    { return level; }
    public int getFortDefense()              { return maxFortDefense; }
    public int getRefDefense()               { return maxRefDefense; }
    public int getWillDefense()              { return maxWillDefense; }
    public int getCurrentFortDefense()       { return currentFortDefense; }
    public int getCurrentRefDefense()        { return currentRefDefense; }
    public int getCurrentWillDefense()       { return currentWillDefense; }
    public int getInitiative()               { return initiative; }
    public int getMaxHP()                    { return maxHP; }
    public int getCurrentHP()                { return currentHP; }
    public int getActionPoints()             { return actionPoints; }
    public int getSpeed()                    { return speed; }
    public int getHealingSurges()            { return healingSurge; }
    public int getAcrobatics()               { return acrobatics; }
    public int getArcana()                   { return arcana; }
    public int getAthletics()                { return athletics; }
    public int getBluff()                    { return bluff; }
    public int getDiplomacy()                { return diplomacy; }
    public int getDungeoneering()            { return dungeoneering; }
    public int getEndurance()                { return endurance; }
    public int getHeal()                     { return heal; }
    public int getHistory()                  { return history; }
    public int getInsight()                  { return insight; }
    public int getIntimidate()               { return intimidate; }
    public int getNature()                   { return nature; }
    public int getPerception()               { return perception; }
    public int getReligion()                 { return religion; }
    public int getStealth()                  { return stealth; }
    public int getStreetwise()               { return streetwise; }
    public int getTheivery()                 { return theivery; }

    public void setStr(int a)                { strength = a; }
    public void setCon(int a)                { constitution = a; }
    public void setDex(int a)                { dexterity = a; }
    public void setInt(int a)                { intelligence = a; }
    public void setWis(int a)                { wisdom = a; }
    public void setCha(int a)                { charisma = a; }
    public void setAC(int a)                 { armorClass = a; }
    public void setLevel(int a)              { level = a; }
    public void setFortDefense(int a)        { maxFortDefense = a; }
    public void setRefDefense(int a)         { maxRefDefense = a; }
    public void setWillDefense(int a)        { maxWillDefense = a; }
    public void setCurrentFortDefense(int a) { currentFortDefense = a; }
    public void setCurrentRefDefense(int a)  { currentRefDefense = a; }
    public void setCurrentWillDefense(int a) { currentWillDefense = a; }
    public void setInitiative(int a)         { initiative = a; }
    public void setMaxHP(int a)              { maxHP = a; }
    public void setCurrentHP(int a)          { currentHP = a; }
    public void setActionPoints(int a)       { actionPoints = a; }
    public void setSpeed(int a)              { speed = a; }
    public void setHealingSurge(int a)       { healingSurge = a; }
    public void setAcrobatics(int a)         { acrobatics = a; }
    public void setArcana(int a)             { arcana = a; }
    public void setAthletics(int a)          { athletics = a; }
    public void setBluff(int a)              { bluff = a; }
    public void setDiplomacy(int a)          { diplomacy = a; }
    public void setDungeoneering(int a)      { dungeoneering = a; }
    public void setEndurance(int a)          { endurance = a; }
    public void setHeal(int a)               { heal = a; }
    public void setHistory(int a)            { history = a; }
    public void setInsight(int a)            { insight = a; }
    public void setIntimidate(int a)         { intimidate = a; }
    public void setNature(int a)             { nature = a; }
    public void setPerception(int a)         { perception = a; }
    public void setReligion(int a)           { religion = a; }
    public void setStealth(int a)            { stealth = a; }
    public void setStreetwise(int a)         { streetwise = a; }
    public void setTheivery(int a)           { theivery = a; }

    public void setStats(int S, int C, int D, int I, int W, int Ch) {
        strength     = S;
        constitution = C;
        dexterity    = D;
        intelligence = I; 
        wisdom       = W;
        charisma     = Ch;
    }

    public void setDefenses(int A, int F, int R, int W) {
        armorClass  = A;
        maxFortDefense = F;
        maxRefDefense  = R;
        maxWillDefense = W;
    }

    public int getModifier(int a) {
        int b = (int) Math.ceil((a - 10) / 2);
        return (a >= 10) ? ((a - 10) /2) : ((a - 11) / 2);
    }

    public int getStrModifier() { return getModifier(strength); }
    public int getConModifier() { return getModifier(constitution); }
    public int getDexModifier() { return getModifier(dexterity); }
    public int getIntModifier() { return getModifier(intelligence); }
    public int getWisModifier() { return getModifier(wisdom); }
    public int getChaModifier() { return getModifier(charisma); }
}
